@use 'design-system' as *;

$z-index-gatsby-overlay: 10100;

html,
body {
    margin: 0;
    padding: 0;
    position: relative;
}

.homepageHero {
    --background-split: 280px;
    --gradient-top: var(--color-brand-200);

    position: relative;
    padding-top: $spacing-size-10;

    &::before,
    &::after {
        content: '';
        position: absolute;
        right: 0;
        left: 0;
        z-index: -1;
    }

    &::before {
        top: 0;
        bottom: var(--background-split);
        background-color: var(--color-bg-site-header);
    }

    &::after {
        height: calc(var(--background-split) + #{$spacing-size-16});
        bottom: #{-$spacing-size-16};
        background: linear-gradient(var(--gradient-top), var(--color-bg-primary));
    }

    #{$selector-darkmode} & {
        --gradient-top: color-mix(in srgb, #000 35%, var(--color-bg-primary));
    }

    @media screen and (min-width: $breakpoint-hero-small) {
        padding-top: $spacing-size-16;
    }

    @media screen and (min-width: $breakpoint-hero-large) {
        padding-top: $spacing-size-24;
    }
}

.heroInner {
    display: flex;
    flex-direction: column;
    gap: 0 $spacing-size-16;

    @media screen and (min-width: $breakpoint-hero-large) {
        flex-direction: row;
    }
}

.heroHeadings {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: center;
    align-items: center;

    h1,
    h2 {
        line-height: var(--text-lh-tight);
        color: var(--color-white);
    }

    h1 {
        font-size: 28px;
        text-align: left;
        flex-direction: column;
        display: inline-flex;
        transform: translateX(0.66em);

        @media screen and (min-width: $breakpoint-hero-small) {
            font-size: var(--text-fs-2xl);
        }

        @media screen and (min-width: $breakpoint-hero-large) {
            font-size: min(3.4vw, 54px);

            margin-top: -0.225em;
            margin-bottom: 0.5em;
        }
    }

    h2 {
        max-width: 18em;
        margin-right: auto;
        margin-left: auto;
        margin-bottom: 1.4em;
        font-weight: var(--text-normal);
        line-height: 150%;

        @media screen and (min-width: $breakpoint-hero-small) {
            font-size: 22px;
        }

        @media screen and (min-width: $breakpoint-hero-large) {
            font-size: 18px;
            max-width: 800px;
        }
    }
}

.heroTopLine {
    display: inline-flex;
}

.heroSectionDemoContainer {
    position: relative;
    margin: $spacing-size-6 auto;
    max-width: calc(var(--layout-max-width-small) + var(--layout-horizontal-margins) * 2);
    padding-right: var(--layout-horizontal-margins);
    padding-left: var(--layout-horizontal-margins);

    @media screen and (max-width: 500px) {
        padding: $spacing-size-4;
    }
}

.loadingLogoContainer {
    position: absolute;
    top: 0;
    right: var(--layout-horizontal-margins);
    bottom: 54px;
    left: var(--layout-horizontal-margins);
    background-color: var(--color-bg-primary);
    border-radius: 8px;

    @media screen and (max-width: 500px) {
        top: $spacing-size-4;
        right: $spacing-size-4;
        bottom: 70px;
        left: $spacing-size-4;
    }

    svg[class*='logo-mark'] {
        position: absolute;
        display: block;
        width: 64px * 2;
        height: 48px * 2;
        top: 50%;
        left: 50%;
        transform: translate(-60px, -48px);
    }
}

.heroSectionGrid {
    height: 449px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.heroLinks {
    position: relative;
    display: flex;
    gap: $spacing-size-2;
    align-items: center;
    margin: $spacing-size-4 0 0;
    justify-content: flex-end;

    :global(.button-tertiary):hover {
        background-color: color-mix(in srgb, var(--color-button-tertiary-bg), transparent 33.3333%);
    }

    a svg {
        --icon-size: #{$spacing-size-6};

        margin-left: -$spacing-size-1;
        margin-right: $spacing-size-1;
    }
}

.homepageFrameworks {
    padding-top: $spacing-size-4;
    padding-bottom: $spacing-size-12;

    @media screen and (min-width: 640px) {
        padding-top: $spacing-size-12;
    }
}

.frameworksInner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: $spacing-size-2;

    @media screen and (min-width: 640px) {
        flex-direction: row;
    }

    @media screen and (min-width: 1020px) {
        gap: $spacing-size-4;
    }
}

.frameworksLabel {
    font-weight: 500;
    @media screen and (min-width: 1020px) {
        --font-size: var(--text--fs-xl);
    }

    #{$selector-darkmode} & {
        color: var(--color-text-primary);
    }
}

.homepageQuotes {
    padding-top: $spacing-size-16;
    padding-bottom: $spacing-size-2;

    @media screen and (min-width: 940px) {
        padding-top: $spacing-size-24;
        padding-bottom: $spacing-size-4;
    }
}

.homepageCustomers {
    padding-bottom: $spacing-size-2;
}

.customersInner {
    text-align: center;

    p {
        margin-left: auto;
        margin-right: auto;
        color: var(--color-text-tertiary);
        opacity: 0.6;
    }
}

.homepageCharts {
    padding-top: $spacing-size-24;
    padding-bottom: $spacing-size-24;

    #{$selector-darkmode} & {
        border-bottom: 1px solid var(--color-border-primary);
    }
}

.chartsInner {
    display: flex;
    flex-direction: column;

    @media screen and (min-width: $breakpoint-grid-homepage-medium) {
        flex-direction: row;
    }
}

.chartsCopy {
    width: 100%;
    margin-bottom: $spacing-size-8;
    text-align: center;

    @media screen and (min-width: $breakpoint-grid-homepage-medium) {
        display: flex;
        flex-direction: column;
        justify-content: center;
        width: 40%;
        margin-bottom: 0;
        padding-right: $spacing-size-8;
        text-align: left;
    }
}

.chartsLogo {
    width: 100%;
    max-width: 320px;
    height: auto;
    margin-bottom: $spacing-size-4;
    margin-left: $spacing-size-4;

    @media screen and (min-width: $breakpoint-grid-homepage-medium) {
        $logo-scale: 1.3;

        margin-bottom: $spacing-size-2;
        margin-left: -$spacing-size-4;

        :global(.logotype) {
            width: 154px * $logo-scale;
            height: 40px * $logo-scale;
        }

        :global(.logomark) {
            width: 64px * $logo-scale;
            height: 48px * $logo-scale;
        }
    }
}

[data-dark-mode='true'] .chartsLogo :global(#LogoType) > * {
    fill: var(--color-white) !important; // !important used to override SVG inline styles
}

.chartsExample {
    width: 100%;

    @media screen and (min-width: $breakpoint-grid-homepage-medium) {
        width: 60%;
    }

    img {
        width: 100%;
        height: auto;
    }

    .chartsExampleDark {
        display: none;
    }

    #{$selector-darkmode} & {
        .chartsExampleLight {
            display: none;
        }

        .chartsExampleDark {
            display: inline;
        }
    }
}

.sponsorshipInner {
    margin-bottom: $spacing-size-20;

    @media screen and (min-width: $breakpoint-sponsorship-large) {
        display: flex;
        justify-content: center;
        gap: $spacing-size-8;
    }

    > div {
        text-align: center;
        margin-bottom: $spacing-size-10;
        list-style: var(--text-lh-tight);

        @media screen and (min-width: $breakpoint-sponsorship-large) {
            text-align: unset;
        }
    }

    > div h3 {
        max-width: 12em;
        margin-left: auto;
        margin-right: auto;
        font-weight: var(--text-light);

        @media screen and (min-width: $breakpoint-sponsorship-large) {
            margin-left: unset;
            margin-right: unset;
        }
    }
}

.projectsList {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.project {
    --icon-size: #{$spacing-size-16};

    display: flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 25em);
    gap: 0 $spacing-size-4;

    &:not(:last-child) {
        margin-bottom: $spacing-size-8 !important;
    }

    img {
        grid-area: icon;
        width: var(--icon-size);
        height: var(--icon-size);
    }

    h3 {
        grid-area: name;
        margin-bottom: 0;
    }

    a {
        grid-area: link;
    }
}

// Invert plunker logo for darkmode
#{$selector-darkmode} .projectPlunker img {
    filter: invert(1);
}

:global(.automated-example-drag) {
    pointer-events: none;

    @media screen and (max-width: $breakpoint-automated-row-grouping-medium) {
        transform-origin: center left;
        transform: translate(-30px, 0) scale(0.5);
    }
}

.heroSectionbuttonContainer {
    display: flex;
    justify-content: center;
    gap: $spacing-size-4;
    margin-bottom: $spacing-size-8;
    margin-top: $spacing-size-12;

    a {
        height: 48px;
        align-items: center;
        display: flex;
    }

    @media screen and (max-width: $breakpoint-landing-page-medium) {
        flex-direction: column;
    }
}

.heroSectioncta2 {
    justify-content: center;
    display: flex;
    align-items: center;
    border-radius: var(--radius-md);
    height: 48px;
    padding: 0px 12px 0px 2px;
    transition: all 0.3s;
}

.heroSectioncta1 {
    display: inline-flex;
    align-items: center;
    gap: $spacing-size-2;
    width: fit-content;
    padding: 0.5em 0.5em 0.5em 1em;

    :global(.icon) {
        --icon-size: #{$spacing-size-4};

        transform: translate(-3px, 1px);
        transition: transform $transition-default-timing;
    }

    &:hover :global(.icon) {
        transform: translate(4px, 1px);
    }
}

.heroButton {
    width: fit-content;
    background-color: var(--color-brand-200);
}

.heroSectionversionTagContainer {
    display: flex;
    border-radius: var(--radius-4xl);
    justify-content: left;
    align-items: left;
    cursor: pointer;
    align-self: left;
    background-color: var(--color-brand-200);
    font-weight: var(--text-bold);
    width: fit-content;
    gap: $spacing-size-2;
    padding: $spacing-size-1 $spacing-size-3;
    margin-bottom: $spacing-size-6;

    #{$selector-darkmode} & {
        background-color: var(--color-bg-secondary);
    }
}

.tabs {
    display: flex;
    flex-direction: row;
    gap: 16px;
    padding: $spacing-size-2 $spacing-size-2;
    font-weight: 500;

    div {
        display: flex;
        gap: 8px;
        padding-bottom: 8px;
    }

    .active {
        border-bottom: 1.5px solid var(--color-white);
    }

    :not(.active) {
        transition: color opacity 0.5s;
        color: var(--color-brand-300);

        img {
            opacity: 0.5;
        }

        &:hover {
            cursor: pointer;
            color: var(--color-white);
            transition: color opacity 0.5s;

            img {
                opacity: 1;
            }
        }
    }

    img {
        height: 20px;
    }
}

.frameworkSelector {
    background-color: color-mix(in srgb, var(--color-fg-primary), var(--color-brand-500) 90%);
    width: 400px;
    border-radius: $spacing-size-2;
    color: var(--color-white);
}

.frameworkCode {
    background-color: color-mix(in srgb, var(--color-fg-primary), var(--color-brand-500) 80%);
    font-family: var(--text-monospace-font-family);
    font-size: var(--text-fs-sm);
    padding: $spacing-size-3;
    border-bottom-left-radius: $spacing-size-2;
    border-bottom-right-radius: $spacing-size-2;
    display: flex;
    justify-content: space-between;
}

.copyToClipboardIcon {
    fill: var(--color-white) !important;
    height: 20px;
    width: 20px;
    cursor: pointer;
    opacity: 0.7;
}

.heroSectionfeatureHighlight {
    font-weight: 500;
}

.sectionContent {
    padding-top: $spacing-size-12;
    width: 100%;
    max-width: var(--layout-max-width-small);
    padding-bottom: $spacing-size-16;
    padding-right: var(--layout-horizontal-margins);
    margin-right: auto;
    margin-left: auto;
}

.tag,
.heading,
.subHeading {
    margin: 0;
}

.tag {
    font-size: var(--text-fs-lg);
    font-weight: var(--text-semibold);
    color: var(--color-util-brand-600);
}

.heading {
    font-size: 40px;
    font-weight: var(--text-bold);
    letter-spacing: -1px;

    @media screen and (max-width: $breakpoint-landing-page-medium) {
        padding: 0;
    }
}

.subHeading {
    color: var(--color-fg-tertiary);
    font-weight: var(--text-fs-regular);
}

.headingContainer {
    display: flex;
    flex-direction: column;
    justify-content: left;
    align-items: left;
    text-align: left;
    margin-bottom: $spacing-size-12;
    gap: $spacing-size-2;
}

.latestNewsVersions {
    --versions-gap: #{$spacing-size-4};
    --background-gradient-top-offset: 50%;
    --background-gradient-height: 15%;

    container-type: inline-size;
    display: flex;
    gap: var(--versions-gap);
    margin-top: $spacing-size-8;
    margin-bottom: $spacing-size-8;

    @media screen and (max-width: 700px) {
        flex-direction: column;
        gap: $spacing-size-3;
    }

    // Hide 3rd item in 2 col layout
    @media screen and (min-width: 700px) and (max-width: 1020px) {
        > *:last-child {
            display: none;
        }
    }
}

.customerSubheading {
    opacity: 0.7;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.sectionContent a {
    width: fit-content;
    margin-top: $spacing-size-3;
}

.themeBuilder {
    width: 100%;
    background-color: var(--color-bg-secondary);
    display: flex;
    justify-content: center;
    height: 300px;
    align-items: center;
    margin-bottom: $spacing-size-16;
}
